<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'contact-form',
    'enableAjaxValidation' => false,
));
?>

<?php echo $form->errorSummary($model, null, null, array('class' => 'message error')); ?>

<p>
    <?php echo $form->labelEx($model, 'name'); ?>
    <?php echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 64, 'class' => 'full')); ?>
</p>

<p>
    <?php echo $form->labelEx($model, 'email'); ?>
    <?php echo $form->textField($model, 'email', array('size' => 60, 'maxlength' => 64, 'class' => 'full')); ?>
</p>

<p>
    <?php echo $form->labelEx($model, 'home_tel'); ?>
    <?php echo $form->textField($model, 'home_tel', array('size' => 32, 'maxlength' => 32, 'class' => 'full')); ?>
</p>

<p>
    <?php echo $form->labelEx($model, 'mobile_tel'); ?>
    <?php echo $form->textField($model, 'mobile_tel', array('size' => 32, 'maxlength' => 32, 'class' => 'full')); ?>
</p>

<p>
    <?php echo $form->labelEx($model, 'work_tel'); ?>
    <?php echo $form->textField($model, 'work_tel', array('size' => 32, 'maxlength' => 32, 'class' => 'full')); ?>
</p>

<p>
    <?php echo $form->labelEx($model, 'fax'); ?>
    <?php echo $form->textField($model, 'fax', array('size' => 32, 'maxlength' => 32, 'class' => 'full')); ?>
</p>

<p>
    <?php echo $form->labelEx($model, 'address'); ?>
    <?php echo $form->textField($model, 'address', array('size' => 60, 'maxlength' => 64, 'class' => 'full')); ?>
</p>

<p>
    <?php echo $form->labelEx($model, 'contact_group_id'); ?> <em>(optional)</em>
    <?php echo $form->dropDownList($model, 'contact_group_id', CHtml::listData(Yii::app()->user->model->contactGroups, 'id', 'name'), array('prompt' => 'select contact group', 'class' => 'full')); ?>
</p>

<div class="action">
    <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('class' => 'button button-gray')); ?>
</div>

<?php $this->endWidget(); ?>